Skip to content

Conversation

@moseshll
Copy link
Contributor

@moseshll moseshll commented Jan 22, 2026

  • Modify the .htaccess rewrite rules for the Bib API so that spaces are escaped and passed through to volumes.php
    • This should reduce or eliminate AH10411: Rewritten query string contains control characters or spaces from the logs
  • Add a bail-out condition in volumes.php:
    • If a query term has been reduced to just whitespace, don't send to Solr
  • Add a filter on all query terms:
    • Remove all spaces after any other normalization has taken place
    • The existing lucene_escape should take care of anything else that might throw Solr for a loop
  • Behavior around when to return a 400 is unchanged. 400 is only returned when all of the query terms or fields are bogus. The return payload is sorta machine readable, e.g. {"message":"query 'something:70628581' is invalid"}
  • Playwright tests for htid and cid queries with spaces; we can expect nginx & httpd behavior to be the same or similar -- where the Bib API is concerned -- now.

- Modify the `.htaccess` rewrite rules for the Bib API so that spaces are escaped and passed through to `volumes.php`
  - This should reduce or eliminate `AH10411: Rewritten query string contains control characters or spaces` from the logs
- Add a bail-out condition in `volumes.php`:
  - If a query term has been reduced to just whitespace, don't send to Solr
- Add a filter on all query terms:
  - Remove all spaces after any other normalization has taken place
  - The existing lucene_escape should take care of anything else that might throw Solr for a loop
- Behavior around when to return a 400 is unchanged. It only gets sent when all of the query terms or fields are bogus.
…ginx behavior is what we expect now from apache.
@moseshll moseshll marked this pull request as ready for review January 26, 2026 18:34
@moseshll moseshll requested a review from aelkiss January 26, 2026 18:34
Copy link
Member

@aelkiss aelkiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems OK to me. I wouldn't expect that removing spaces is necessarily going to get results where there weren't any, but I don't think it hurts.

@moseshll moseshll merged commit cabb27b into main Jan 27, 2026
2 checks passed
@moseshll moseshll deleted the ETT-1246_oclc_space branch January 27, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants